/******************************************************************************* * Copyright (c) 2012, Project: FP7-ICT-257930 Aniketos * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * - Neither the name of institution nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ /** */ package eu.aniketos.mtm.idm.model.idm.impl; import eu.aniketos.mtm.idm.model.idm.DocumentRoot; import eu.aniketos.mtm.idm.model.idm.IdmFactory; import eu.aniketos.mtm.idm.model.idm.IdmPackage; import eu.aniketos.mtm.idm.model.idm.IdmType; import eu.aniketos.mtm.idm.model.idm.Roles; import eu.aniketos.mtm.idm.model.idm.TypeType; import eu.aniketos.mtm.idm.model.idm.Users; import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EDataType; import org.eclipse.emf.ecore.EEnum; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.impl.EPackageImpl; import org.eclipse.emf.ecore.xml.type.XMLTypePackage; /** * <!-- begin-user-doc --> * An implementation of the model <b>Package</b>. * <!-- end-user-doc --> * @generated */ public class IdmPackageImpl extends EPackageImpl implements IdmPackage { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass documentRootEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass idmTypeEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass rolesEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass usersEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EEnum typeTypeEEnum = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EDataType typeTypeObjectEDataType = null; /** * Creates an instance of the model <b>Package</b>, registered with * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package * package URI value. * <p>Note: the correct way to create the package is via the static * factory method {@link #init init()}, which also performs * initialization of the package, or returns the registered package, * if one already exists. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see org.eclipse.emf.ecore.EPackage.Registry * @see eu.aniketos.mtm.idm.model.idm.IdmPackage#eNS_URI * @see #init() * @generated */ private IdmPackageImpl() { super(eNS_URI, IdmFactory.eINSTANCE); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private static boolean isInited = false; /** * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. * * <p>This method is used to initialize {@link IdmPackage#eINSTANCE} when that field is accessed. * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #eNS_URI * @see #createPackageContents() * @see #initializePackageContents() * @generated */ public static IdmPackage init() { if (isInited) return (IdmPackage)EPackage.Registry.INSTANCE.getEPackage(IdmPackage.eNS_URI); // Obtain or create and register package IdmPackageImpl theIdmPackage = (IdmPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof IdmPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new IdmPackageImpl()); isInited = true; // Initialize simple dependencies XMLTypePackage.eINSTANCE.eClass(); // Create package meta-data objects theIdmPackage.createPackageContents(); // Initialize created meta-data theIdmPackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theIdmPackage.freeze(); // Update the registry and return the package EPackage.Registry.INSTANCE.put(IdmPackage.eNS_URI, theIdmPackage); return theIdmPackage; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getDocumentRoot() { return documentRootEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getDocumentRoot_Mixed() { return (EAttribute)documentRootEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getDocumentRoot_XMLNSPrefixMap() { return (EReference)documentRootEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getDocumentRoot_XSISchemaLocation() { return (EReference)documentRootEClass.getEStructuralFeatures().get(2); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getDocumentRoot_Idm() { return (EReference)documentRootEClass.getEStructuralFeatures().get(3); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getIdmType() { return idmTypeEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getIdmType_Roles() { return (EReference)idmTypeEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getIdmType_Users() { return (EReference)idmTypeEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getRoles() { return rolesEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getRoles_Value() { return (EAttribute)rolesEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getRoles_Type() { return (EAttribute)rolesEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getUsers() { return usersEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getUsers_Value() { return (EAttribute)usersEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getUsers_Role() { return (EAttribute)usersEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EEnum getTypeType() { return typeTypeEEnum; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EDataType getTypeTypeObject() { return typeTypeObjectEDataType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IdmFactory getIdmFactory() { return (IdmFactory)getEFactoryInstance(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private boolean isCreated = false; /** * Creates the meta-model objects for the package. This method is * guarded to have no affect on any invocation but its first. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void createPackageContents() { if (isCreated) return; isCreated = true; // Create classes and their features documentRootEClass = createEClass(DOCUMENT_ROOT); createEAttribute(documentRootEClass, DOCUMENT_ROOT__MIXED); createEReference(documentRootEClass, DOCUMENT_ROOT__XMLNS_PREFIX_MAP); createEReference(documentRootEClass, DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); createEReference(documentRootEClass, DOCUMENT_ROOT__IDM); idmTypeEClass = createEClass(IDM_TYPE); createEReference(idmTypeEClass, IDM_TYPE__ROLES); createEReference(idmTypeEClass, IDM_TYPE__USERS); rolesEClass = createEClass(ROLES); createEAttribute(rolesEClass, ROLES__VALUE); createEAttribute(rolesEClass, ROLES__TYPE); usersEClass = createEClass(USERS); createEAttribute(usersEClass, USERS__VALUE); createEAttribute(usersEClass, USERS__ROLE); // Create enums typeTypeEEnum = createEEnum(TYPE_TYPE); // Create data types typeTypeObjectEDataType = createEDataType(TYPE_TYPE_OBJECT); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private boolean isInitialized = false; /** * Complete the initialization of the package and its meta-model. This * method is guarded to have no affect on any invocation but its first. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void initializePackageContents() { if (isInitialized) return; isInitialized = true; // Initialize package setName(eNAME); setNsPrefix(eNS_PREFIX); setNsURI(eNS_URI); // Obtain other dependent packages XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); // Create type parameters // Set bounds for type parameters // Add supertypes to classes // Initialize classes and features; add operations and parameters initEClass(documentRootEClass, DocumentRoot.class, "DocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getDocumentRoot_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getDocumentRoot_XMLNSPrefixMap(), ecorePackage.getEStringToStringMapEntry(), null, "xMLNSPrefixMap", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getDocumentRoot_XSISchemaLocation(), ecorePackage.getEStringToStringMapEntry(), null, "xSISchemaLocation", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getDocumentRoot_Idm(), this.getIdmType(), null, "idm", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); initEClass(idmTypeEClass, IdmType.class, "IdmType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getIdmType_Roles(), this.getRoles(), null, "roles", null, 0, 2, IdmType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getIdmType_Users(), this.getUsers(), null, "users", null, 0, -1, IdmType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(rolesEClass, Roles.class, "Roles", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getRoles_Value(), theXMLTypePackage.getString(), "value", null, 1, -1, Roles.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getRoles_Type(), this.getTypeType(), "type", null, 0, 1, Roles.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(usersEClass, Users.class, "Users", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getUsers_Value(), theXMLTypePackage.getString(), "value", null, 1, -1, Users.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getUsers_Role(), theXMLTypePackage.getString(), "role", null, 0, 1, Users.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); // Initialize enums and add enum literals initEEnum(typeTypeEEnum, TypeType.class, "TypeType"); addEEnumLiteral(typeTypeEEnum, TypeType.HUMAN); addEEnumLiteral(typeTypeEEnum, TypeType.SERVICES); // Initialize data types initEDataType(typeTypeObjectEDataType, TypeType.class, "TypeTypeObject", IS_SERIALIZABLE, IS_GENERATED_INSTANCE_CLASS); // Create resource createResource(eNS_URI); // Create annotations // http:///org/eclipse/emf/ecore/util/ExtendedMetaData createExtendedMetaDataAnnotations(); } /** * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createExtendedMetaDataAnnotations() { String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; addAnnotation (this, source, new String[] { "qualified", "false" }); addAnnotation (documentRootEClass, source, new String[] { "name", "", "kind", "mixed" }); addAnnotation (getDocumentRoot_Mixed(), source, new String[] { "kind", "elementWildcard", "name", ":mixed" }); addAnnotation (getDocumentRoot_XMLNSPrefixMap(), source, new String[] { "kind", "attribute", "name", "xmlns:prefix" }); addAnnotation (getDocumentRoot_XSISchemaLocation(), source, new String[] { "kind", "attribute", "name", "xsi:schemaLocation" }); addAnnotation (getDocumentRoot_Idm(), source, new String[] { "kind", "element", "name", "idm", "namespace", "##targetNamespace" }); addAnnotation (idmTypeEClass, source, new String[] { "name", "idm_._type", "kind", "elementOnly" }); addAnnotation (getIdmType_Roles(), source, new String[] { "kind", "element", "name", "roles", "namespace", "##targetNamespace" }); addAnnotation (getIdmType_Users(), source, new String[] { "kind", "element", "name", "users", "namespace", "##targetNamespace" }); addAnnotation (rolesEClass, source, new String[] { "name", "roles", "kind", "elementOnly" }); addAnnotation (getRoles_Value(), source, new String[] { "kind", "element", "name", "value", "namespace", "##targetNamespace" }); addAnnotation (getRoles_Type(), source, new String[] { "kind", "attribute", "name", "type" }); addAnnotation (typeTypeEEnum, source, new String[] { "name", "type_._type" }); addAnnotation (typeTypeObjectEDataType, source, new String[] { "name", "type_._type:Object", "baseType", "type_._type" }); addAnnotation (usersEClass, source, new String[] { "name", "users", "kind", "elementOnly" }); addAnnotation (getUsers_Value(), source, new String[] { "kind", "element", "name", "value", "namespace", "##targetNamespace" }); addAnnotation (getUsers_Role(), source, new String[] { "kind", "attribute", "name", "role" }); } } //IdmPackageImpl